package Test;

/**
 * Created by 春旺 on 2017/4/27.
 */
public class Calc {
    public static void main(String[] args) {

        int result = 0;

        if (args.length == 3) {
            System.out.println("Usage: java Calc operato1 operand(+ - * / %) operator2");
            int a = Integer.parseInt(args[0]);
            int b = Integer.parseInt(args[2]);
            if (args[1].equals("+")) {
                result = a + b;
            } else if (args[1] .equals("-")) {
                result = a - b;
            } else if (args[1].equals("/") ) {
                result = a / b;
            } else
                result = a * b;
        }


        //+ - * / 和%运算

        System.out.println(args[0] + " " + args[1] + " " + args[2] + " = " + result);
    }
}

